<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="com.nk.system.beans.*, java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>โปรไฟล์</title>

<style type="text/css">
#t-body {
   width:1000px;/*ขนาดความกว้างของเพจ*/
   margin:0px auto;
}
#header{
	margin:0 0 10 0;
	/*padding:10px;*/
	height:auto;
	width:auto;
	background-color:white;
	border-bottom: solid 0.5px #FFFF99;
}/* margin: บน ขวา ล่าง ซ้าย; ตามเข็มนาฬิกาครับ*/
#header2{
	float:right;
	margin:0 0 10 0;
	/*padding:10px;*/
	height:auto;
	width:100%;
	background-color: #FFFFCC;
	border-bottom: solid 1px #FFFF99;
}
#left{
	float:left;
	width:1000px;
	margin:0 0 10px 0;
	height:570px;
	background-color: white;
}
#right{
	float:right;
	width:1000px;
	margin:0 0 10px 0;
	height:500px;
	background-color: white;
}
#content{
	float:right;
	width:590px;
	margin:0 0 10px 10px;
	height:200px;
	background-color:#00FFCC;
}
#footer{
	clear:both;
	padding:20px;
	height:40px;
	background-color:#00FF00;
}
#menu{
     padding:0;
     margin:0; 
     position:relative;
}
#menu ul{
     padding:0; 
     margin:0; 
     list-style:none; 
     float:left; 
}
#menu ul li{
     height:auto;
     padding:0 0 0 10px; 
     margin:0 5px 0 0; 
     display:block; 
     float:left; 
     background:url("images/submenu-l.gif") no-repeat left;
}
#menu ul li a{
     width:auto;
     height:auto; 
     padding:0px 21px 0 10px; 
     margin:0; 
     float:left; 
     font:bold 13px/24px Tahoma, Verdana, sans-serif; 
     color:#7A6B44; 
     text-align:center; 
     text-decoration:none; 
     background:url("images/submenu-r.gif") no-repeat right; 
}
#menu ul li a:hover{
     text-decoration:underline;
}
#menu ul li.current{
     margin:0 5px 0 0;
     display:block; 
     float:left; 
     font:bold 13px/24px Tahoma, Verdana, sans-serif; 
     color:#fff; 
     /* background:url(submenu-active-l.gif) no-repeat left; */
}
#menu ul li.current span{
     padding:0px 21px 0 10px; 
     margin:0; 
     display:block; 
     float:left; 
     /* background:url(submenu-active-r.gif) no-repeat right; */
}
</style>

</head>
<body bgcolor="gray">
<form action="UpdateUserServlet" method="post">
	<div id="t-body">
		<div id="header">
			<div class="logo-img">
        		<img src="images/new3.png" style="width: 1000px;height: 200px " id="logo" />
    		</div>
		</div>
		<div id="header2">
    		<div id="menu">
    			<ul>
        			<li><a href="MainServlet">หน้าแรก</a></li>
        			<li><a href="BachelorServlet2">ปริญญาตรี</a></li>
        			<li><a href="MasterServlet2">ปริญญาโท</a></li>
        			<li><a href="DoctorServlet2">ปริญญาเอก</a></li>
        			<li><a href="WebboardServlet">กระดานสนทนา</a></li>
        			<li><a href="ContactServlet">ติดต่อเรา</a></li>
    			</ul>
			</div>
		</div>
		<div id="left">
		<a style="font-size:small;color:blue"" href="BachelorServlet"> ปริญญาตรี</a> -> <a style="font-size:small;color:blue" href="LoginServlet">ข้อมูลผู้ใช้</a> -> <a style="font-size:small;color:blue">แก้ไขข้อมูลผู้ใช้</a>
		<center><br>
		<h1>สมัครสมาชิก</h1>
		<table border="1" bordercolor="black" cellpadding="5">
			<tbody>
				<%
					UserProfileBean userProfileBean = (UserProfileBean)request.getAttribute("users");
				%>
				<tr>
					<td><div align="left">ชื่อผู้ใช้</div></td>
					<td><div align="left"><input disabled="disabled" name="username" type="text" value="<%= userProfileBean.getUsername() %>"></div></td>
				</tr>
				<!-- <tr>
					<td><div align="left">รหัสผ่าน</div></td>
					<td><div align="left"><input name="password1" type="password" maxlength="16" size="21"></div></td>
				</tr> -->
				<tr>
					<td><div align="left">ชื่อ</div></td>
					<td><div align="left"><input name="firstName" type="text" value="<%= userProfileBean.getFirstname() %>"></div></td>
				</tr>
				<tr>
					<td><div align="left">นามสกุล</div></td>
					<td><div align="left"><input name="lastName" type="text" value="<%= userProfileBean.getLastname() %>"></div></td>
				</tr>
				<tr>
					<td><div align="left">เพศ</div></td>
					<td><div align="left">
						<% if(userProfileBean.getSex().equals("male")){ %>
						<select name="sex">
							<option value="1" selected="selected">ชาย</option>
							<option value="2">หญิง</option>
						</select>
						<%} else{%>
						<select name="sex">
							<option value="1">ชาย</option>
							<option value="2" selected="selected">หญิง</option>
						</select>
						<%} %>
						</div>
					</td>
				</tr>
				<tr>
					<td><div align="left">วันเกิด</div></td>
					<td><div align="left"><input name="firstName" disabled="disabled" type="text" value="<%= userProfileBean.getBirthday() %>"></div></td>
				</tr>
				<tr>
					<td><div align="left">โรงเรียน</div></td>
					<td><div align="left"><input name="school" type="text" value="<%= userProfileBean.getSchool() %>"></div></td>
				</tr>
				<tr>
					<td><div align="left">ชั้นมัธยมศึกษาที่</div></td>
					<td><div align="left"><input name="level" type="text" value="<%= userProfileBean.getLevel() %>"></div></td>
				</tr>
				<tr>
					<td><div align="left">เกรดเฉลี่ย</div></td>
					<td><div align="left"><input name="grade" type="text" value="<%= userProfileBean.getGrade() %>"></div></td>
				</tr>
				<tr>
					<td><div align="left">e-mail</div></td>
					<td><div align="left"><input name="mail" type="text" style="width: 6cm;" disabled="disabled" value="<%= userProfileBean.getEmail()%>"></div></td>
				</tr>
				<tr>
					<td colspan="2" align="center"><input type="submit" value="ยืนยัน"></td>
				</tr>
			</tbody>
		</table>
		</center>
		</div>
	</div>
</form>
</body>
</html>